<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	template="./../template.xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core">
	
	<ui:define name="tituloJanela">
		<title>Cadastrar Novo Status para Incidente</title>
	</ui:define>

	<ui:define name="tituloCima">
		<h1>Cadastrar Novo Status para Incidente</h1>
	</ui:define>
	
	<ui:define name="conteudo">
		<h:form id="tabelaForm">
			<p:messages></p:messages>
			<p:panel header="Cadastrar Status para Incidente">
			<h:panelGrid columns="2" style="margin-bottom:10px" cellpadding="5">
			
				<h:outputLabel value="Nome: "/>
				<p:inputText value="#{statusIncidenteMB.statusIncidente.descricao}" required="true" 
					requiredMessage="Entre com o nome do status para o incidente." size="33"/>
					
				<h:outputLabel value="Sequencia Atendimento: " />  
		        <p:selectOneMenu value="#{statusIncidenteMB.statusIncidente.sequenciaAtendimento}" effect="fade" required="true"
		        	requiredMessage="Selecione a sequencia de atendimento para o incidente." style="width: 340px;">  
		            <f:selectItem itemLabel="Selecionar" itemValue=""/>  
		            <f:selectItems value="#{sequenciaAtendimentoMB.sequenciaAtendimentoItens}"/>
		        </p:selectOneMenu>
		        <p:spacer  rendered="#{statusIncidenteMB.isEdicao()}"/>
				<p:inputText value="#{statusIncidenteMB.nomeSequenciaAtendimento}" disabled="true" rendered="#{statusIncidenteMB.isEdicao()}"
					size="33"/>
					
			</h:panelGrid>
		    </p:panel>	        	
			<br/>
			<p:commandButton action="#{statusIncidenteMB.adicionaStatusIncidente}" value="Salvar" update=":tabelaForm" ajax="false"/>
		</h:form>
	</ui:define>
</ui:composition>